﻿using Firestarter.DB.Schema.BO;
using FireStarterModeller.Test;

namespace Firestarter.DB.Schema.Test.BO.TestUtils
{
    public partial class TestUtilsModelModification
    {
        /// <summary>
        /// Creates a new saved ModelModification with a random value assigned to every property
        /// </summary>
        public static ModelModification CreateSavedModelModification()
        {
            ModelModification modelModification = CreateUnsavedValidModelModification();
            modelModification.Save();
            return modelModification;
        }

        /// <summary>
        /// Creates a new unsaved ModelModification with a random value assigned to every property
        /// </summary>
        public static ModelModification CreateUnsavedValidModelModification()
        {
            ModelModification modelModification = new ModelModification();
            modelModification.Description = TestUtilsShared.GetRandomString();
            modelModification.ReverseEngineeringID = TestUtilsReverseEngineering.CreateSavedReverseEngineering().ReverseEngineeringID;
            modelModification.Approved = TestUtilsShared.GetRandomBoolean();
            return modelModification;
        }
	    
        /// <summary>
        /// Creates a new unsaved ModelModification where all properties are null, except ID properties
        /// and those with default values.  If there are compulsory properties without
        /// defaults, saving the object will throw an exception.
        /// </summary>
        public static ModelModification CreateUnsavedDefaultModelModification()
        {
            ModelModification modelModification = new ModelModification();
            return modelModification;
        }
    }
}